<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

<#include "../../common/header.html">

<link rel="stylesheet" href="${resurcePath}/cloudpay/css/loading/jquery.mloading.css">
<script src="${resurcePath}/cloudpay/js/uploadPreview/uploadPreview.min.js"></script>
<script src="${resurcePath}/cloudpay/js/loading/jquery.mloading.js"></script>
</head>
<body class="hold-transition skin-blue sidebar-mini">
	<div class="wrapper">

		<!-- 	顶部和左侧菜单的jsp s -->
		<#include "../../common/menu.html">
		<!-- 	顶部和左侧菜单的jsp e -->

		<!-- Content Wrapper. Contains page content -->
		<div class="content-wrapper">
			<!-- Content Header (Page header) -->
			<section class="content-header">
				<h1>新建id</h1>
			</section>

			<!-- Main content -->
			<section class="content" style="padding-bottom: 0px;" id="content">
				<!-- general form elements -->
				<div class="box box-primary" style="width: 1000px; margin: 0 auto;">
					<div class="box-header with-border">
						<h3 class="box-title">新建信息</h3>
					</div>
					<!-- /.box-header -->
					<!-- form start -->
					<form action="/hicatcard/userThird/batchMakeUserThird" method="post" id="roleForm"  enctype="multipart/form-data">
					   	    
						<div class="box-body">
							<div class="form-group">
								<label for="prefix">前缀</label>
								<input type="text" class="form-control" id="prefix" name="prefix" /> 
							</div>	
							<div class="form-group">
								<label for="beginId">首个id</label>
								<input type="text" class="form-control" id="beginId" name="beginId" /> 
							</div>						
							<div class="form-group">
								<label for="amount">数量</label>
								<input type="text" class="form-control" id="amount" name="amount" /> 
							</div>							
						</div>
						<!-- /.box-body  @click="submit"-->
						<div class="box-footer">
							<button type="submit" class="btn btn-primary">提交并导出</button>
							<button type="reset" class="btn btn-primary" >清空</button>
						</div>
					</form>
				</div>
				<!-- /.box -->
			</section>
			<!-- /.content -->
		</div>

	</div>
	<!-- ./wrapper -->
</body>
<script>
$(function() {
	
	
	
	//校验器
	var formValidator = $("#roleForm").validate({
				onkeyup : false,
				focusInvalid : false,  //错误时,错误选项不会得到焦点
				focusCleanup : true,   //得到焦点时，清空错误提示信息
				submitHandler : function() { //表单提交句柄,为一回调函数，带一个参数：form
					var beginId = $("#beginId").val();
				    var amount = $("#amount").val();
				    var prefix = $("#prefix").val();
					 $.ajax({
						 url : '/hicatcard/userThird/batchMakeUserThird',
						 type : "POST",
						 dataType:"json",
						 data : {
							 beginIdStr : beginId ,
							 amount : amount,
							 prefix : prefix
						 },
						 beforeSend :function() {
							  $("body").mLoading("show");
						 },
						 success : function(result) {
							
							// window.location.href = result;
							if("201110" == result.result_code) {
								alert(result.error_message);
							} else {
								window.open(result.error_message);  
								window.location.reload();
							}					
						 },
						 complete : function() {
							 $("body").mLoading("hide");
						 }
						
					 });	
				},
				rules : {						
					beginId : {
						required:true,
						digits:true,
						minlength:5,
						maxlength:5
					
					},
					amount : {
						required:true,
						digits:true,
						max:200,
						min:1
					},
					prefix : {
						required:true,
						minlength:3,
						maxlength:3
					}
				},
				messages : {		
					beginId : {
						required:"请输入数量",
						digits:"只能输入整数",
						minlength:"必须是5位",
						maxlength:"必须是5位"
					},
					
					amount : {
						required:"请输入数量",
						digits:"只能输入整数",
						max:"不能大于200张",
						min:"必须大于1张"
					},
					prefix : {
						required:"请输入前缀",
						minlength:'必须是3位',
						maxlength:'必须是3位'
						
					}
				}
			});
	
});

</script>
</html>